package com.mars.nacos.domain.service.impl;

import com.alibaba.fastjson.JSON;
import com.mars.nacos.api.dto.response.UserInfoResDTO;
import com.mars.nacos.domain.constant.CommonConstant;
import com.mars.nacos.domain.service.UserAppApiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author : kyrie
 * @date : 2022/8/24 10:25
 * #desc    : some description
 */
@Service
@Slf4j
public class UserAppApiServiceImpl implements UserAppApiService {
    @Resource
    private CommonConstant commonConstant;

    @Override
    public UserInfoResDTO getUserInfo() {
        log.info("读取配置中心数据为: commonConstant={}", JSON.toJSONString(commonConstant));
        return UserInfoResDTO.builder().headUrl(commonConstant.getHeadUrl()).nickName(commonConstant.getNickName()).build();
    }
}
